#include <iostream>
#include <unistd.h>
using namespace std;

int main()
{
    pid_t id =  fork();

    if (id == 0)
    {
        cout << "i am child task, my pid is " << getpid() << " ppid is " << getppid() << endl;
        sleep(5);
    }
    else 
    {
        while(1)
        {
             cout << "i am parent task, my pid is " << getpid() << " ppid is " << getppid() << endl;
             sleep(1);
        }
    }
    return 0;
}
